package com.webdemo03.action;

import java.sql.Connection;
import java.sql.PreparedStatement;

import com.opensymphony.xwork2.ActionSupport;
import com.webdemo03.util.DBHandler;

public class DeleteUser extends ActionSupport{
	private static final long serialVersionUID = 1L;
	private int id;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	@Override
	public String execute() throws Exception {
		Connection conn = DBHandler.newInstance().getConnection();
		String sql = "delete from xml02_user where id=?";
		PreparedStatement pstmt = conn.prepareStatement(sql);
		pstmt.setInt(1, id);
		pstmt.executeUpdate();
		return "show";
	}
}
